package EightQueens;

/**
 * 
 * @author Sebastian Brodehl, Dennis Meyer
 *
 */

public class Run {

	public static void main(String[] args) {
		
		// Create an initial population
		Population pop = new Population(20, true);
		
		// Evolve the population until we reach an optimum solution
		int generationCount = 0;
		while (pop.getFittest().getFitness() != 28) {
			generationCount++;
			System.out.println("Generation: " + generationCount + " Fittest: " + pop.getFittest().getFitness());
			pop = Algorithm.evolvePopulation(pop);
		}
		
		System.out.println("Solution found!");
        System.out.println("Generation: " + generationCount);
        System.out.print("Genes: ");
        System.out.println(pop.getFittest());
	}

}
